@import './variables.less';
@import './mixins.less';

@font-face {
  font-family: 'icomoon';
  src:  url('../icomoon/icomoon.eot?h6xgdm');
  src:  url('../icomoon/icomoon.eot?h6xgdm#iefix') format('embedded-opentype'),
    url('../icomoon/icomoon.ttf?h6xgdm') format('truetype'),
    url('../icomoon/icomoon.woff?h6xgdm') format('woff'),
    url('../icomoon/icomoon.svg?h6xgdm#icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
}

.doc-block {
  padding: 20px;

  h1 {
    font-weight: bold;
    color: #000;
    font-size: 20px;
  }

  h2, h3, h4, h5 {
    font-weight: 400;
    color: #1f2f3d;
  }

  h2 {
    font-size: 28px;
    margin: 0;
  }

  h3 {
    font-size: 22px;
    margin: 55px 0 20px;
  }

  p {
    font-size: 14px;
    color: #5e6d82;
    line-height: 1.5em;

    a {
      color: @brand-primary;
    }
  }

  [class^="icon-"] {
    /* use !important to prevent issues with browser extensions that change fonts */
    font-family: 'icomoon' !important;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
  
    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .icon-rate-face-off:before {
    content: "\e900";
  }
  .icon-rate-face-1:before {
    content: "\e901";
  }
  .icon-rate-face-2:before {
    content: "\e902";
  }
  .icon-rate-face-3:before {
    content: "\e903";
  }

  .sec-block-content,
  .doc-demo-desc {
    > p {
      margin-block-start: 1em;
      margin-block-end: 1em;
    }
  }

  p code,
  .el-table code {
    background-color: #f9fafc;
    padding: 0 4px;
    border: 1px solid #eaeefb;
    border-radius: 4px;
  }

  .tip {
    padding: 8px 16px;
    background-color: #fffaf2;
    border-radius: 4px;
    border-left: 5px solid @brand-primary;
    margin: 20px 0;

    blockquote {
      display: block;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 40px;
      margin-inline-end: 40px;
    }

    p {
      margin-block-start: 1em;
      margin-block-end: 1em;
    }

    &.warning {
      border-left-color: #fe6c6f;
      background-color: #fff6f7;
    }
  }
}

.doc-table {
  margin-bottom: 45px;
}

.doc-demo {
  margin-bottom: 24px;
  border: 1px solid #ebebeb;
  border-radius: 3px;
  transition: .2s;

  code {
    font-family: Menlo, Monaco, Consolas, Courier, monospace;
  }

  &:hover {
    box-shadow: 0 0 8px 0 rgba(232, 237, 250, .6), 0 2px 4px 0 rgba(232, 237, 250, .5);

    .doc-demo-control {
      i {
        transform: translateX(-40px);
      }

      > span {
        opacity: 1;
      }
    }
  }
}

.doc-demo-source {
  padding: 24px;
}

.doc-demo-meta {
  background-color: #fafafa;
  border-top: 1px solid #eaeefb;
  overflow: hidden;
  transition: height .2s;
  height: 0;

  .hljs {
    line-height: 1.8;
    font-size: 12px;
    padding: 18px 24px;
    background-color: #fafafa;
  }

  &.is-expanded {
    height: auto;
  }
}

.doc-demo-desc {
  padding: 20px;
  border: 1px solid #ebebeb;
  border-radius: 3px;
  line-height: 22px;
  color: #666;
  word-break: break-word;
  margin: 10px;
  background-color: #fff;

  code {
    color: #5e6d82;
    background-color: #e6effb;
    margin: 0 4px;
    display: inline-block;
    padding: 1px 5px;
    font-size: 12px;
    border-radius: 3px;
    height: 18px;
    line-height: 18px;
  }

  p {
    margin: 0;
    line-height: 26px;
  }
}

.doc-demo-control {
  border-top: solid 1px #eaeefb;
  height: 44px;
  box-sizing: border-box;
  background-color: #fff;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  text-align: center;
  margin-top: -1px;
  color: #d3dce6;
  cursor: pointer;
  position: relative;

  &.is-fixed {
    position: fixed;
    bottom: 0;
    width: 868px;
  }

  i {
    font-size: 16px;
    line-height: 44px;
    transition: .3s;
  }

  > span {
    opacity: 0;
    position: absolute;
    transition: opacity .3s;
    transform: translateX(-30px);
    font-size: 14px;
    line-height: 44px;
  }

  &:hover {
    color: #409EFF;
    background-color: #f9fafc;
  }

  & .text-slide-enter,
  & .text-slide-leave-active {
    opacity: 0;
    transform: translateX(10px);
  }
  
  .control-button {
    line-height: 26px;
    position: absolute;
    top: 0;
    right: 0;
    font-size: 14px;
    padding-left: 5px;
    padding-right: 25px;
  }
}
